-
Notifications
You must be signed in to change notification settings - Fork 50
chore(testing): use random seed instead of hardcoding #985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
c189c0a to
677c7ca
Compare
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I like this change. I commented on some stylistic preferences but I'm not asking you to change those things. My requested changes are:
- remove the TODO
- either remove
// sig fmt: offand// sig fmt: onor consolidate it back to one line - restore the
.or find another solution for the problem it was supposed to solve
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to resolve all my conversations in the other review after responding to my questions.
5e86bbb to
d4350cd
Compare
0a71dd5 to
f222f2d
Compare
It's preferred to use the random seed provided by the stdlib (which changes every run, but is deterministic, and can be passed into the test runner again to reproduce identical results), instead of just hardcoding a single number. This ensures the unit doesn't have some hidden dependence on the seed of the prng used.
Had to fix a couple cases just like this, where we would hardcode expected results which depend on the seed to the prng. The change makes it clearer what inputs are used to get said output.
Almost the entire diff is just that, maybe a few little fixes in random places.